package com.think.domain;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface ConditionMapper extends ThinkMapper{
	@Select("SELECT " +
			"condition_id as conditionId, " +
			"count as count " +
			"FROM health.condition WHERE condition_id = #{conditionId}")
	Condition getConditionById(@Param("conditionId") Integer conditionId);
	
	@Select("SELECT count(*) FROM health.condition")
	public int numberOfConditions();
	
	@Insert("INSERT INTO health.condition (condition_id, count) values (#{condition.conditionId}, #{condition.count})")
	public Integer insertCondition(@Param("condition") Condition condition);
	
	@Insert("INSERT INTO health.values (key_id, value, locale, att_name) " +
			"values (#{value.keyId}, #{value.value}, #{value.locale})")
	public Integer insertValue(@Param("value") Value value);
}
